#include<stdio.h>
/*int my_strlen(char* p) {
	char* pa = p;
	while ( * p != '\0') {
		p++;
	}
	return p - pa;    //指针运算
}
int main() {
	char arr[] = "abcdef";
	int len = my_strlen(arr);
	printf("%d", len);
	return 0;
}*/
#include<assert.h>
size_t my_strlen(const char* p) {
	char* p1 = p;
	//assert(p != NULL);
	while (*p++ != '\0');
	return (p - p1 - 1);
}
int main() {
	char arr[] = "abcdef";
	printf("%zd\n", my_strlen(arr));
	return 0;
}
